package com.yanqu.road.server.cmd.match;

import com.yanqu.road.pb.variety.VarietyProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.match.MatchModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @author ：zfr
 * @date ：2021/2/7 15:53
 */
@Cmd(code = GameProtocol.S_VARIETY_GET_REWARD_FROM_CROSS, desc = "跨服发奖返回")
public class GetRewardFromCrossCmd extends AbstractCommand {
    private VarietyProto.GetRewardCrossRespMsg msg;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        if (packet.getBytes() != null) {
            msg = VarietyProto.GetRewardCrossRespMsg.parseFrom(packet.getBytes());
        }
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.getModule(MatchModule.class).getRewardFromCross(msg);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
